#ifndef alice_h
#define alice_h

#include "WProgram.h"
#include <goldelox.h>
#include <math.h>

#include <Time.h>  
#include <DB.h>  

#define PIN_TEMP_SENSOR 0


int memoryTest();

float HHMMSStoDegress(int h,int m,float s);
float HHMMSStoRadians(int h,int m,float s);

void toHorizontal(float ra,float de,float latitude,float T,float& azimuth,float& altitude);
void toEcuatorial(float azimuth,float altitude,float latitude,float T,float &ra,float &de);
float LocalSideralTime(time_t unixtime,float longitude);
float COSangularDistance(float ra1,float dec1,float ra2,float dec2);
float angularDistance(float ra1,float dec1,float ra2,float dec2); 





class alice : public goldeloxPlus , public SD_DB
{
	private:
    		void DB_write_byte(unsigned long address, byte data);
    		byte DB_read_byte(unsigned long address);
		float Gsize; //FOV show in each image
		int imageN;
		unsigned long offset[SD_MR_RECORDS];


	public:
		float Xsize,Ysize,size;
		float X0,Y0;
		float ra,dec;
		float az,alt;
		float LST;
		float lat,lon;


		alice();
		void  SDinit();

		int  tileN();

		void showRaDec();
		void showAzAlt();
		void showLST();		
		void showEcuatorial();
		void showHorizontal();

		void showTemp();
		void showMemory();
		void showScreen(int n);
		void showCrossPoint();
		void showMark(float r,float d, int t);
		void showLabel(float r,float d, char* t);
		void showDistanceTo(float ra0,float dec0);


		void showNGC();
		void showMR(); //Master record
		void listObjects();
		void showObjects();
		void showNearest(int t);
		void showMessierData(int M);
		void Image(unsigned long image,int atlas);


};




#endif


